Skip to content

Run the before-publish build only in the publish run - #243

Closed
vgpopov wants to merge 1 commit into
v4-betafrom
fix/before-publish-build-main-only
Closed

vgpopov wants to merge 1 commit into
v4-betafrom
fix/before-publish-build-main-only

Conversation

@vgpopov

@vgpopov vgpopov commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Problem

Run build (before publish) in node-simple-pnpm.yaml has no condition. It runs on pull_request, merge_group, and the main run that commits the version bump. A block passes build-before-publish-script-name: build:release, which is the default of the block-tools template since platforma 83298ed6a7. Since MILAB-6497, block-tools software build uploads the binaries in that build when PL_BUILD_LOCATION=remote. Before that, the upload ran in prepublishOnly, only at npm publish.

PR runs also apply changeset version, so a PR run uploads the binaries of the next release version. When the PR changes its bump or closes, that version stays in the registry. The release that later gets the version finds the file. package-builder-lib core.ts logs already exists … Upload was skipped, and the step stays green. The release then ships the old binaries.

Incident: clonotype-clustering 4.3.0

Run What happened
PR #156, run 39406490270 (Oct 20) The first push had software: minor. The run computed 4.2.1 → 4.3.0 and uploaded …/4.3.0.tgz with the 4.2.x scripts. The PR then switched to patch and released 4.2.2.
PR #163, run 42624024397 (Nov 9) software: minor gave 4.2.3 → 4.3.0. Turbo cache miss: the build ran, and all four uploads were skipped as already exists.
Merge queue and main runs Turbo replayed that task (d25cdc827d826de1), and the release shipped descriptors for the old files.

The process-results/4.3.0.tgz on bin.pl-open.science has file dates of Oct 20 12:44 CEST, and its content is identical to 4.2.3. clonotype-clustering#164 worked around it with 4.3.1.

Change

The step now uses the condition of Pack unpublished npm packages:

if: github.ref_name == 'main'
  && steps.check-changes.outputs.has-changes == '0'
Run Run build (build-script-name) Run build (before publish)
pull_request runs skipped
merge_group (gh-readonly-queue/…) runs skipped
push main, version bump pending (has-changes == '1') runs skipped; the bot commits the bump
push main, nothing to bump (has-changes == '0') runs runs, then pack and publish

Tradeoff

PR runs no longer run the release-channel build. A failure that only build:release shows appears first on main. build-script-name (build:dev-local for blocks) still builds the whole workspace on every PR.

Not in this PR

  • Registry slots already taken by earlier PR runs stay. Each one is a trap for a later release of the same version.
  • block-tools run-build.ts does not pass failExisting for the release channel, so a taken slot is a warning and not an error.

Check

actionlint reports no new findings: the same 20 findings as v4-beta, all from earlier code.

The step had no condition, so it ran on pull_request, merge_group, and
the main run that commits the version bump. A block passes build:release
here, and block-tools software build uploads binaries in that build.
A PR run with a changeset version uploads the binaries of a version that
is not released yet. When the PR changes its bump, that version stays in
the registry. The later release finds the file, skips the upload with a
warning, and ships the old binaries.

clonotype-clustering: PR #156 run 39406490270 uploaded software 4.3.0
from 4.2.1 code. Release 4.3.0 (PR #163) skipped the upload and shipped
those files.

Use the condition of the npm pack step: main, with no version-bump
changes left.
@greptile-apps

greptile-apps Bot commented Nov 11, 2026

Copy link
Copy Markdown

Automatic reviews are disabled for this repository. Configure in Code Review Settings.

@vgpopov

vgpopov commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

Replaced by #244, which targets v4 directly.

@vgpopov vgpopov closed this Nov 11, 2026
@vgpopov
vgpopov deleted the fix/before-publish-build-main-only branch November 11, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant